<template>
  <!-- vue3页面 -->
  <a-card :bodyStyle="{ padding: '24px' }">
    <a-row type="flex" align="middle">
      <a-col :span="17">
        <a-carousel arrows autoplay>
          <template #prevArrow>
            <div class="custom-slick-arrow" style="left: 10px; z-index: 1">
              <left-circle-outlined />
            </div>
          </template>
          <template #nextArrow>
            <div class="custom-slick-arrow" style="right: 10px">
              <right-circle-outlined />
            </div>
          </template>
          <div>
            <img
              class="img"
              src="https://mp-c7d1b689-cd39-420a-83f9-733c744450c6.cdn.bspapp.com/work/微信图片_20231008141328.jpg"
              alt=""
            />
          </div>
          <div>
            <img
              class="img"
              src="https://mp-c7d1b689-cd39-420a-83f9-733c744450c6.cdn.bspapp.com/work/微信图片_20231008141329.jpg"
              alt=""
            />
            >
          </div>
          <div>
            <img
              class="img"
              src="https://mp-c7d1b689-cd39-420a-83f9-733c744450c6.cdn.bspapp.com/work/微信图片_20231008141330.jpg"
              alt=""
            />
            >
          </div>
          <div>
            <img
              class="img"
              src="https://mp-c7d1b689-cd39-420a-83f9-733c744450c6.cdn.bspapp.com/work/微信图片_20231008141331.jpg"
              alt=""
            />
            >
          </div>
          <div>
            <img
              class="img"
              src="https://mp-c7d1b689-cd39-420a-83f9-733c744450c6.cdn.bspapp.com/work/微信图片_202310081413311.jpg"
              alt=""
            />
            >
          </div>
        </a-carousel>
      </a-col>
      <a-col :span="5" offset="1">
        <a-row>
          <a-col :span="24" style="margin-top: 10px">
            <a-card hoverable>
              <a-statistic :value="9999" style="">
                <template #title>
                  <a-tag color="red">精选留言</a-tag>
                </template>
              </a-statistic>
            </a-card>
          </a-col>
          <a-col :span="24" style="margin-top: 10px">
            <a-card hoverable>
              <a-statistic :value="1" style="">
                <template #title>
                  <a-tag color="blue">历史留言</a-tag>
                </template>
              </a-statistic>
            </a-card>
          </a-col>
          <a-col :span="24" style="margin-top: 10px">
            <a-card hoverable>
              <a-statistic :value="9999" style="">
                <template #title>
                  <a-tag color="blue">已回复留言</a-tag>
                </template>
              </a-statistic>
            </a-card>
          </a-col>
          <a-col :span="24" style="margin-top: 10px">
            <a-card hoverable>
              <a-statistic :value="9999" style="">
                <template #title>
                  <a-tag color="cyan">我的留言</a-tag>
                </template>
              </a-statistic>
            </a-card>
          </a-col>
        </a-row>
        <div class="btn" @click="open = true">申请公开</div>
      </a-col>
    </a-row>
    <!-- 留言列表 -->
    <MyMessage @viewMessage="viewMessage"></MyMessage>
    <a-drawer
      destroyOnClose
      v-model:visible="open"
      width="50%"
      title="申请公开"
      placement="right"
    >
      <MyPublic />
    </a-drawer>

    <a-modal
      v-model:visible="view"
      width="50%"
      :footer="null"
      wrapClassName="card"
    >
      <MyView :messageData="message" />
    </a-modal>
  </a-card>
</template>

<script setup lang="ts">
import { ref } from "vue";
import { LeftCircleOutlined, RightCircleOutlined } from "@ant-design/icons-vue";
import MyMessage from "./components/apply/messageList.vue";
import MyPublic from "./components/apply/applyPublic.vue";
import MyView from "./components/apply/viewMessage.vue";
const open = ref(false);
const view = ref(false);
const message = ref();
const viewMessage = (val: any) => {
  console.log(val);

  view.value = true;
};
// const ob = {
//   a: 1,
//   b: 2,
//   c: 3,
// };

// Object.prototype[Symbol.iterator] = function iterator() {
//   let self = this;
//   let index = -1;
//   let keys = Reflect.ownKeys(self);
//   return {
//     next() {
//       index++;
//       return {
//         value: self[keys[index]],
//         done: index >= keys.length,
//       };
//     },
//   };
// };
// for (const key of ob) {
//   console.log(key);
// }
</script>
<style>
.ant-modal-content {
  background-color: transparent;
  box-shadow: none;
}
</style>
<style scoped lang="less">
.ant-carousel :deep(.slick-slide) {
  text-align: center;
  height: 400px;
  line-height: 400px;
  background: pink;
  overflow: hidden;
  border-radius: 10px;
}

.ant-carousel :deep(.slick-arrow.custom-slick-arrow) {
  width: 25px;
  height: 25px;
  font-size: 25px;
  color: #fff;
  background-color: rgba(31, 45, 61, 0.11);
  opacity: 0.3;
  z-index: 1;
}
.ant-carousel :deep(.custom-slick-arrow:before) {
  display: none;
}
.ant-carousel :deep(.custom-slick-arrow:hover) {
  opacity: 0.5;
}

.ant-carousel :deep(.slick-slide h3) {
  color: #fff;
}

.btn {
  width: 100%;
  height: 60px;
  background-color: #1890ff;
  color: #fff;
  border-radius: 10px;
  text-align: center;
  line-height: 60px;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 20px;
}
.applyData {
  width: 100%;
  height: calc(400px - 80px);
  background-color: #1890ff;
  border-radius: 20px;
  color: #fff;
}
:deep(.ant-statistic) {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
:deep(.ant-card-body) {
  padding: 10px 40px;
}
:deep(.ant-statistic-title) {
  margin-bottom: 0;
}
:deep(.ant-tag) {
  padding: 5px 10px;
  font-size: 18px;
}
:deep(.ant-statistic-content-value-int) {
  margin-left: 20px;
  text-align: right;
}
.img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
</style>
